VERSION 5.00
Begin VB.Form frmDebugSC 
   BorderStyle     =   5  'Sizable ToolWindow
   Caption         =   "Scripts - Debug Windows"
   ClientHeight    =   2130
   ClientLeft      =   165
   ClientTop       =   780
   ClientWidth     =   6810
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2130
   ScaleWidth      =   6810
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.PictureBox picSciMain 
      BorderStyle     =   0  'None
      Height          =   2055
      Left            =   0
      ScaleHeight     =   2055
      ScaleWidth      =   6735
      TabIndex        =   0
      Top             =   0
      Width           =   6735
   End
   Begin VB.Menu mnuClear 
      Caption         =   "Clear"
   End
   Begin VB.Menu mnuExit 
      Caption         =   "Exit"
   End
End
Attribute VB_Name = "frmDebugSC"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'-----------------------------------------------------------------
'             PT DC Hub @ Direct Connect P2P Network
'-----------------------------------------------------------------
'       Developer: Carlos.DF (fLaSh) - Portugal
'          E-mail: carlosferreiracarlos@hotmail.com
' Project started: 10 - September - 2006
'         License: GNU General Public License.
'-----------------------------------------------------------------
'       Thanks to developers and contributores of SDCH/DDCH
'         The Left Hand, ButterflySoul, HaArD and Selyb
'  TheNOP, RollTheDice, JDommi, GhOstFaCE, ArchaicLight and TUFF
'-----------------------------------------------------------------
Option Explicit

'Cool FX Magnetic Windows
Private Magnetic        As New clsMagneticWnd
Private m_objSciLexer   As clsYScintilla
Private m_bIsIniSCI     As Boolean
Private m_bDateTime     As Boolean

Private Sub Form_Load()
1:  On Error GoTo Err

3:    Set m_objSciLexer = New clsYScintilla
    
5:    If g_objSettings.MagneticWin Then _
          Call Magnetic.AddWindow(frmDebugSC.hwnd)        'Cool FX Windows
    
8:     m_objSciLexer.CreateScintilla picSciMain
9:     m_objSciLexer.SetFixedFont "Courier New", 10
    
      'This is absolutly an imperative line
12:    m_objSciLexer.Attach picSciMain
    
14:    m_objSciLexer.Folding = False
15:    m_objSciLexer.ShowCallTips = False
16:    m_objSciLexer.LineNumbers = True
17:    m_objSciLexer.AutoIndent = False
18:    m_objSciLexer.ReadOnly = False
    
20:    m_objSciLexer.SetMarginWidth MarginLineNumbers, 50
 
26:  Exit Sub
    
28:
Err:
29:  HandleError Err.Number, Err.Description, Erl & "|" & "frmDebugSC.Form_Load()"
End Sub

Private Sub Form_Resize()
1:   On Error Resume Next
2:   picSciMain.Width = Me.ScaleWidth
3:   picSciMain.Height = Me.ScaleHeight
4:   m_objSciLexer.SizeScintilla 0, 0, Me.ScaleWidth / Screen.TwipsPerPixelX, (Me.ScaleHeight / Screen.TwipsPerPixelY)
End Sub

Private Sub Form_Unload(Cancel As Integer)
1:   Magnetic.RemoveWindow frmDebugSC.hwnd
     'This is absolutly an imperative line
3:   m_objSciLexer.Detach picSciMain
4:   Set m_objSciLexer = Nothing
End Sub
Public Sub WriteLine(ByVal sText As String)
1:    On Error GoTo Err
2:    Dim strTemp As String

3:    If m_objSciLexer Is Nothing Then Form_Load
     
4:    If m_bDateTime Then
5:        strTemp = "[" & Now & "]" & sText & vbNewLine
6:    Else
7:        strTemp = sText & vbNewLine
8:    End If

11:   m_objSciLexer.GotoLine m_objSciLexer.GetLastLine
12:   m_objSciLexer.SetSelText strTemp

13:   Exit Sub
14:
Err:
15:   HandleError Err.Number, Err.Description, Erl & "|" & "frmDebugSC.WriteLine(" & sText & ")"
End Sub

Public Sub Clear()
1:    If m_objSciLexer Is Nothing Then Form_Load
2:    m_objSciLexer.Text = ""
End Sub

Public Property Let DateTime(ByVal bDateTime As Boolean)
1:    On Error Resume Next
2:    DateTime = m_bDateTime
End Property

Private Sub mnuClear_Click()
1:    Call Clear
End Sub

Private Sub mnuExit_Click()
1:    Me.Hide
End Sub

